home *** CD-ROM | disk | FTP | other *** search
- class MiniGames.JFS.JFSJellyFish extends State
- {
- var oParent;
- var mcRef;
- static var sSTATE_IDLE = "Idle";
- static var sSTATE_REMOVING = "Removing";
- static var sSTATE_REMOVED = "Removed";
- static var sSTATE_REACT = "React";
- function JFSJellyFish(_mcRef, _oParent)
- {
- super(_mcRef);
- this.oParent = _oParent;
- this.setState(MiniGames.JFS.JFSJellyFish.sSTATE_IDLE);
- var _loc5_ = Math.round(Math.random() * this.mcRef.mcState._totalframes - 1) + 1;
- this.mcRef.mcState.gotoAndPlay(_loc5_);
- this.mcRef.mcState.mcHeart.gotoAndPlay(_loc5_);
- this.giveEvent();
- }
- function leaveBus()
- {
- this.setState(MiniGames.JFS.JFSJellyFish.sSTATE_REMOVING);
- Controller.getRef().getSounds().playSound("JellyFish_Leave",Controller.nSFX_VOLUME,1);
- }
- function giveEvent()
- {
- this.mcRef.onPress = Delegate.create(this,this.register);
- }
- function removeEvent()
- {
- delete this.mcRef.onPress;
- this.mcRef.onPress = null;
- }
- function react()
- {
- this.setState(MiniGames.JFS.JFSJellyFish.sSTATE_REACT);
- }
- function doPause()
- {
- super.doPause();
- for(var i in this.mcRef.mcState)
- {
- this.mcRef.mcState[i].stop();
- }
- }
- function doUnPause()
- {
- super.doUnPause();
- for(var i in this.mcRef.mcState)
- {
- this.mcRef.mcState[i].play();
- }
- }
- function register()
- {
- this.oParent.takeHook(this);
- }
- function Idle()
- {
- }
- function Removing()
- {
- if(this.stateFinished())
- {
- this.setState(MiniGames.JFS.JFSJellyFish.sSTATE_REMOVED);
- this.oParent.decreaseJellyFishCount();
- }
- }
- function React()
- {
- }
- function Removed()
- {
- }
- }
-